import { defineStore } from 'pinia'
export const useUserInfoStore = defineStore('userInfo', {
  state: () => {
    return {
      userInfo: JSON.parse(sessionStorage.getItem('userInfo')) || "",
    }
  },
  actions:{
    setUserInfo(log){
      this.userInfo = log;
      sessionStorage.setItem(`userInfo`, JSON.stringify(log))
    },
    removeUserInfo(){
      this.userInfo = "";
      sessionStorage.removeItem(`userInfo`)
    }
  }
})

